package com.zhongkun.datahome.service.req.qry.sku;

import com.zhongkun.datahome.service.domain.Sku;
import com.zhongkun.datahome.service.processor.dto.HouseMaterialDto;
import com.zhongkun.datahome.service.processor.dto.SkuDto;
import com.zhongkun.datahome.service.req.cmd.sku.SkuCmd;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @Author: lifengsheng
 * @Date: 2025/4/15 11:49
 * @Desc
 */
@Data
public class SkuExistQry{

    @ApiModelProperty(value = "商品名称")
    private String skuName;

    @ApiModelProperty(value = "商品类目")
    private String category;

    @ApiModelProperty(value = "单位")
    private String unit;

    @ApiModelProperty(value = "品牌")
    private String brandName;

    @ApiModelProperty("商品规格/尺寸")
    private String specification;

    public static SkuExistQry of(SkuDto sku) {
        SkuExistQry skuExistQry = new SkuExistQry();
        skuExistQry.setBrandName(sku.getBrandName());
        skuExistQry.setCategory(sku.getCategory());
        skuExistQry.setSkuName(sku.getSkuName());
        skuExistQry.setUnit(sku.getUnit());
        skuExistQry.setSpecification(sku.getSpecification());
        return skuExistQry;
    }

    public static SkuExistQry of(HouseMaterialDto dto) {
        SkuExistQry skuExistQry = new SkuExistQry();
        skuExistQry.setBrandName(dto.getBrandName());
        skuExistQry.setCategory(dto.getCategory());
        skuExistQry.setSkuName(dto.getSkuName());
        skuExistQry.setUnit(dto.getUnit());
        skuExistQry.setSpecification(dto.getSpecification());
        return skuExistQry;
    }

    public static SkuExistQry of(SkuCmd cmd) {
        SkuExistQry skuExistQry = new SkuExistQry();
        skuExistQry.setBrandName(cmd.getBrandName());
        skuExistQry.setCategory(cmd.getCategory());
        skuExistQry.setSkuName(cmd.getSkuName());
        skuExistQry.setUnit(cmd.getUnit());
        skuExistQry.setSpecification(cmd.getSpecification());
        return skuExistQry;
    }
}
